< previous page page_578 next page >

Page 578
Tip.gif
Notice the use of the Variant data type to return an array of items. This is a very efficient way to pass array data among Visual Basic methods.

Now create a new Public Sub called Dump. This writes the trace list to a disk file. Fill in the method with the code from Listing 14.35.
Type.gifListing 14.35. Coding the Dump method of the TraceObject.
Public Sub Dump()
    '
    ' write trace log to file
    Dim intFile As Integer
    Dim intLoop As Integer
    '
    intFile = FreeFile
    Open trcFileName For Append As intFile
        Print #intFile, "***TRACE STACK DUMP***"
        Print #intFile, "***DATE: " & Format(Now(), "general date")
        Print #intFile, ""
        '
        For intLoop = trcPointer To 1 Step -1
            Print #intFile, vbTab & Format(intLoop, "000") & ": " &
arrow.giftrcStack(intLoop)
        Next
        '
        Print #intFile, ""
        Print #intFile, "***EOF"
    Close #intFile
    '
    Exit Sub
    '
LocalErr:
    Err.Raise vbObjectError + 3, "Trace.Dump", "Can't write trace file [" &
arrow.giftrcFileName & "]"
    '
End Sub
Finally, create the Public Sub method called Show and enter the code from Listing 14.36.
Type.gifListing 14.36. Coding the Show method of the TraceObject.
Public Sub Show()
    '
    ' show trace log in dialog
    '
    Dim intLoop As Integer
    Dim strMsg As String

 
< previous page page_578 next page >

If you like this book, buy it!